<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .container {
      border: 1px solid #aaa;
      height: 300px;
      width: 300px;
      padding: 20px;
    }

    /*
      transition: transition-property transition-duration transition-timing-function transition-delay;
      过渡可为一个元素在不同状态之间切换时定义不同的效果
    */
    .container .box01 {
      display: block;
      width: 200px;
      height: 50px;
      background-color: #eee;
      /* border: 1px solid #aaa; */
      border-radius: 8px;
      cursor: pointer;
      /* transition: width .4s; */
      transition: width .4s ease-in-out;
    }
    .container .box01:hover {
      width: 100px;
    }
    
  </style>
</head>
<body>
  <div class="container">
    <span class="box01"></span>
  </div>

</body>
</html>